package com.medica.ledproject.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xiaona
 * @date 2024/5/30
 * @description TODO
 */
@Configuration
public class ResourcesConfig implements WebMvcConfigurer
{
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry)
    {

        /** 通过url访问项目外的目录图片*/
        //服务器环境
        System.out.println("1111111111111");
//        registry.addResourceHandler("/images/**").addResourceLocations("file:/www/wwwroot/LedJava/upload/");
        //本地环境
        registry.addResourceHandler("/images/**").addResourceLocations("file:/D:/java/ledFiles/");
    }
}
